//
//  JPMOrgM.swift
//
//  Created by 邱仙凯 on 2022/4/11
//  Copyright (c) . All rights reserved.
//

import Foundation
import ObjectMapper

public struct JPMOrgM: Mappable {

  // MARK: Declaration for string constants to be used to decode and also serialize.
  private struct SerializationKeys {
    static let cDeptNmHs = "c_dept_nm_hs"
    static let rowNum = "row_num"
    static let cAddress = "c_address"
    static let cProvince = "c_province"
    static let cDeptIdHs = "c_dept_id_hs"
  }

  // MARK: Properties
  public var cDeptNmHs: String?
  public var rowNum: Int?
  public var cAddress: String?
  public var cProvince: String?
  public var cDeptIdHs: String?

  // MARK: ObjectMapper Initializers
  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public init?(map: Map){

  }

  /// Map a JSON object to this class using ObjectMapper.
  ///
  /// - parameter map: A mapping from ObjectMapper.
  public mutating func mapping(map: Map) {
    cDeptNmHs <- map[SerializationKeys.cDeptNmHs]
    rowNum <- map[SerializationKeys.rowNum]
    cAddress <- map[SerializationKeys.cAddress]
    cProvince <- map[SerializationKeys.cProvince]
    cDeptIdHs <- (map[SerializationKeys.cDeptIdHs],StringTransform())
  }

  /// Generates description of the object in the form of a NSDictionary.
  ///
  /// - returns: A Key value pair containing all valid values in the object.
  public func dictionaryRepresentation() -> [String: Any] {
    var dictionary: [String: Any] = [:]
    if let value = cDeptNmHs { dictionary[SerializationKeys.cDeptNmHs] = value }
    if let value = rowNum { dictionary[SerializationKeys.rowNum] = value }
    if let value = cAddress { dictionary[SerializationKeys.cAddress] = value }
    if let value = cProvince { dictionary[SerializationKeys.cProvince] = value }
    if let value = cDeptIdHs { dictionary[SerializationKeys.cDeptIdHs] = value }
    return dictionary
  }

}
